home *** CD-ROM | disk | FTP | other *** search
- /*
- *
- * Copy string "in" in string "out"
- * and set rest of string "out" to blanks.
- *
- *
- * CopyRight 1995. Nicholas Poljakov all rights reserved.
- *
- */
- #include <string.h>
- #include <memory.h>
-
- copy (char *out, char *in, int l)
- {
- int i;
-
- if (l <= 0) {
- return -1;
- }
- i = strlen(in);
- if (i > l) {
- return -1;
- }
- else
- memcpy(out, in, i);
- if (i == l) {
- return 0;
- }
- memset(&out[i], 32, l - i);
- return 0;
- }
-